<%@page import="com.tn.bo.UserProfile" %>
<%	
	
	long userId = 0;
	UserProfile userProfile = (UserProfile)request.getSession().getAttribute("userProfile"); 
	if(userProfile != null){
		userId = userProfile.getUserProfileId();
	}
	
	
%>
<script type="text/javascript">
var loggedInUserId = "<%=userId%>";

</script>
<%@ include file="/includes/header_public.html"%>
    	<ul class="hm_links">
            	<li><a href="/index2.jsp">HOME</a></li>
                <li><a href="#">ABOUT ATSOCII</a></li>
                <li><a href="#">INDUSTRY NEWS</a></li>
                <li><a href="#">CUSTOMER SUPPORT</a></li>
        </ul>
 <div id="registration_div" style="display:none;" class="yui-skin-sam">
 <div class="home_middle" style="margin-left:350px;">
  <div id="rightside">
  <article>
    	<header><h2>Company Registration Form </h2></header>
    	 <b>Dear <%=userProfile.getSalutation() + " " + userProfile.getFirstName() + " " + userProfile.getLastName()%>, Please associate your company here</b> <br>
    	
    	 <div class="group" id="createDiv">
                <div class="lblDiv">Company Name: <span>*</span></div>
                <div class="cntrlDiv"><input type="text" name="" id="reg_companyName" /> <a href="javascript:showCompanyLookup();"> Company Lookup</a></div>
                <div class="lblDiv">Doing Business As: <span>*</span></div>
                <div class="cntrlDiv"><input type="text" name="" id="reg_lob" /></div>
                <div class="lblDiv">Tax Id: </div>
                <div class="cntrlDiv"><input type="text" name="" id="reg_taxId" /></div>
                <div class="lblDiv">SSN: </div>
                <div class="cntrlDiv"><input type="text" name="" id="reg_SSN" /></div>
                <div class="lblDiv">Other Id Type: </div>
                <div class="cntrlDiv">
                	<select name="" id="company_reg_idType" class="tiny_ddl">
                    	<option value="PAN">PAN</option>
                        <option value="VAT">VAT</option>
                    </select>
                </div>
                <div class="lblDiv">Other Id Value: </div>
                <div class="cntrlDiv"><input type="text" name="" id="company_reg_idValue" /></div>
                <div class="fullDiv"><span class="tiny_text">For non-US companies please specify Id type</span></div>
                <div class="lblDiv">Company Contact: <span>*</span></div>
                <div class="cntrlDiv"><input type="text" class="txtBoxBig" name="" id="reg_CompanyContact" /></div>
                <div class="lblDiv">&nbsp;</div>
                <div class="cntrlDiv">&nbsp;</div>
                <div class="lblDiv">Company Address: <span>*</span></div>
                <div class="cntrlDivBig"><input type="text" class="txtBoxBig" name="" id="reg_compAddressLine1" placeholder="Street Line1 Address" /></div>
                <div class="lblDiv">&nbsp;</div>
                <div class="cntrlDivBig"><input type="text" class="txtBoxBig" name="" id="reg_compAddressLine2" placeholder="Street Address Line 2" /></div>
                <div class="lblDiv">&nbsp;</div>
                 <div class="cntrlDivBig"><input type="text" class="txtBoxBig" name="" id="reg_compAddressLine3" placeholder="Street Address Line 3" /></div>
                <div class="lblDiv">&nbsp;</div>
                <div class="cntrlDiv"><input type="text" name="" id="reg_compCity" placeholder="City" /></div>
                <div class="lblDiv">&nbsp;</div>
                <div class="cntrlDiv"><input type="text" name="" id="reg_compState" placeholder="State / Province" /></div>
                <div class="lblDiv">&nbsp;</div>
                <div class="cntrlDiv"><input type="text" name="" id="reg_compZip" placeholder="Postal / Zip Code " /></div>
                <div class="lblDiv">&nbsp;</div>
                <div class="cntrlDiv">
                	<select name="" id="reg_compCountry">
                    	<option value="">Select Country</option>
                        <option value="">United States</option>
                        <option value="">Others</option>
                    </select>
                </div>
                <div class="lblDiv">Phone Number:  <span>*</span></div>
                <div class="cntrlDiv">
                	<input type="text" class="txtBoxTiny" name="" id="reg_areaCodePhone" placeholder="Area" /> - 
                    <input type="text" class="txtBoxSmall" name="" id="reg_areaCodePhoneNumber" placeholder="Phone Number" />
                </div>
                <div class="lblDiv">FAX:</div>
                <div class="cntrlDiv">
                	<input type="text" class="txtBoxTiny" name="" id="reg_areaCodeFax" placeholder="Area" /> - 
                    <input type="text" class="txtBoxSmall" name="" id="reg_areaCodeFaxNumber" placeholder="Phone Number" />
                </div>
                <div class="lblDiv">Email: </div>
                <div class="cntrlDiv"><input type="text" name="" id="reg_compEmail" /></div>
                <div class="lblDiv">Company URL: </div>
                <div class="cntrlDiv"><input type="text" name="" id="reg_compURL" /></div>
                <div class="lblDiv">Default Cuurency: <span>*</span></div>
                <div class="cntrlDiv">
                	<select class="form-dropdown validate[required]" style="width:150px" id="reg_compCurrency" name="q22_defaultCuurency">
		                        <option>  </option>
		                        <option value="Option 1"> Option 1 </option>
		
		                        <option value="Option 2"> Option 2 </option>
		                        <option value="Option 3"> Option 3 </option>
		                    </select>
                </div>
                <div class="lblDiv">&nbsp;</div>
                <div class="cntrlDiv">&nbsp;</div>
                <div class="lblDiv">Payment Terms: <span>*</span></div>
                <div class="cntrlDivBig" style="height:100px;">
					<select multiple="multiple" size="4" id="reg_compPaymentTerms">
					<option value="US00">US00 - Net 1 Day</option>
					<option value="US01">US01 - Net 2 Day</option>
					<option value="US02">US02 - 1% discount if paid within 10
					days, Net 30 days</option>
					<option value="US03">US03 - Net 3 Day</option>
					<option value="US04">US04 - 2% discount if paid within 10
					days, Net 30 days</option>
					<option value="US05">US05 - Net 5 days</option>
					<option value="US06">US06 - 2% discount if paid within 15
					days, Net 30 Days</option>
					<option value="US07">US06 - 2% discount if paid within 15
					days, Net 30 Days</option>
					<option value="US08">US08 - 1% discount if paid within 15
					days, Net 30 Days</option>
					<option value="US09">US09 - 2% discount if paid within 10
					days, Net 11 Days</option>
					<option value="US10">US10 - Net 10 days</option>
					<option value="US11">US11 - 1.5% discount if paid within 10
					days, Net 16 Days</option>
					<option value="US12">US12 - 1% discount if paid within 14
					days, Net 15 Days</option>
					<option value="US13">US13 - 2% discount if paid within 15
					days, Net 16 Days</option>
					<option value="US14">US14 - 3% discount if paid within 10
					days, Net 30 Days</option>
					<option value="US15">US15 - Net 15 days</option>
					<option value="US16">US16 - 0.5% discount if paid within 10
					days, Net 30 Days</option>
					<option value="US17">US17 - 2% discount if paid within 10
					days, Net 31 Days</option>
					<option value="US18">US18 - 10% discount if paid within 10
					days, Net 30 Days</option>
					<option value="US19">US19 - 5% discount if paid within 20
					days, Net 30 Days</option>
					<option value="US20">US20 - Net 20 days</option>
					<option value="US21">US21 - 2% discount if paid within 15
					days, Net 60 Days</option>
					<option value="US22">US22 - 1% discount if paid within 30
					days, Net 31 Days</option>
					<option value="US30">US30 - Net 30 days</option>
					<option value="US40">US40 - Net 40 days</option>
					<option value="US45">US45 - Net 45 days</option>
					<option value="US50">US50 - Net 50 days</option>
					<option value="US60">US60 - Net 60 days</option>
				</select>
				
				</div>
				
				
                        
                   <div class="cntrlDivBig">
				            <input id="input_2" onclick="tn_registerCompany('<%=userId%>');" type="submit"  value="Register My Company">
					</div>
                        
               
            </div>
            </div>
         </article>
 </div>
</div>
 <div id="searchCompany_div" class="yui-skin-sam"> 
<div class="home_middle" style="margin-left:350px;">
	<div id="rightside">
		<article>
        <header><h2>Search Company Form </h2></header>
        Dear <%=userProfile.getSalutation() + " " + userProfile.getFirstName() + " " + userProfile.getLastName()%>  Search Your Company or You Can Register a New Company If Its Not Registered With Us</b>
    	 <div class="group" id="createDiv">
    	
				<div class="lblDiv">Company Name: <span>*</span></div>
                <div class="cntrlDiv"><input type="text" name="" id="search_companyName" /></div>
                <div class="lblDiv">Doing Business As: <span>*</span></div>
                <div class="cntrlDiv"><input type="text" name="" id="reg_lob" /></div>
                <div class="lblDiv">Tax Id: </div>
                <div class="cntrlDiv"><input type="text" name="" id="commgm_ctaxid" /></div>
                <div class="lblDiv">SSN: </div>
                <div class="cntrlDiv"><input type="text" name="" id="commgm_cssn" /></div>
                <div class="lblDiv">Other Id Type: </div>
                <div class="cntrlDiv">
                	<select name="" id="company_reg_idType" class="tiny_ddl">
                    	<option value="PAN">PAN</option>
                        <option value="VAT">VAT</option>
                    </select>
                </div>
                <div class="lblDiv">Other Id Value: </div>
				<div class="cntrlDiv"><input type="text" name="" id="company_reg_serach_idValue" /></div>   	
				        	 <div class="halfDiv">&nbsp;</div>
				<div class="btnDiv">
            	<div class="lblDiv">&nbsp;</div>
            	<div class="cntrlDivBig">
				            <input id="registerButton" onclick="tn_comapnyRegister_serachCompany();"   type="submit"  value=" Search Company">
				            
				            <input id="registerButton" onclick="javascript:tn_showRegisterComapnyDiv();"  type="submit"  value=" Register New Company">
				            
				</div>
         	</div>
				       
			<div id="comapnySerachDivYUITable" class="yuidtskinnedstyle"></div>
				    
			
			
			</div>
    	 </div>
      </article>
</div></div>

<div  id="super_userPanel"  style="margin:15px 50px 15px 50px ;" style="dispaly:none" class="yui-skin-sam">

	<div class="hd">Super User Request.</div>
	<div class="bd">
		   <article>
        	<header><h2>Send Approval Request to following Super user Of <span id="selectedCompanyNameSpan"></span></h2></header>
			 <div class="group" id="createDiv">
				<div class="lblDiv">&nbsp;</div>
                <div class="cntrlDiv">
				
				<div  id="superuser0">             
	                </div>
				
				
				</div>
				
				<div class="lblDiv">&nbsp;</div>
				<div class="lblDiv">&nbsp;</div>
                <div class="cntrlDiv">
				
				<div  id="superuser1">             
	                </div>
				
				
				</div>
				
				<div class="btnDiv">
            	<input type="submit" name="" id="" value="Send Approval Request" onclick="tn_sendApproveRequest();"> 
            	
            	 </div>
				 
				
				</article>
		</div>
	    </div>
	    <div class="ft"></div>
	    
	</div>
	
	<div  id="super_userSucceeRegPanel"  style="margin:15px 50px 15px 50px ;" style="dispaly:none" class="yui-skin-sam">

	<div class="hd">Super User Roles.</div>
	<div class="bd">
	    <div>
	    	
	        
	        <div>Congratulation!!You are the First User Registered. You have been given super user level access.<br><br><ul><li>
	          You can make changes to your company profile.</li><li>
	          You can add/modify/delete the suppliers that you do business with. This will be maintained as the master list of suppliers.</li><li>
	          You can manage the list of users in your company, give/delete access.</li><li>
	          You can manage the clients you do business with.</li></ul>
	        </div>
	        
	        <br>
	        <div align='center'><input type='button' value='close' onclick='closeCompanyAssociationPanel();'> </div>
	        
	       
	    </div>
	    </div>
	    <div class="ft"></div>
	    
	</div>
		  
  
 
 
 <div class="claer_div"></div>

<%@ include file="/jsp/yui_includes.jsp"  %>
<script>
function showCompanyLookup(){
	$("searchCompany_div").style.display = "block";
	$("registration_div").style.display = "none";
}

var super_userPanel = new YAHOO.widget.Panel("super_userPanel", { width:"600",constraintoviewport:true,close:true,fixedcenter:true,modal:true });
super_userPanel.render();
super_userPanel.hide();

var super_userSucceeReg = new YAHOO.widget.Panel("super_userSucceeRegPanel", { width:"600",constraintoviewport:true,close:true,fixedcenter:true,modal:true });
super_userSucceeReg.render();
super_userSucceeReg.hide();

function tn_showRegisterComapnyDiv(){
	
	
	$("searchCompany_div").style.display = "none";
	$("registration_div").style.display = "block";
}

function closeCompanyAssociationPanel(){
	super_userSucceeReg.hide();
}
</script>

<script type='text/javascript' src='/dwr/engine.js'></script>
<script type='text/javascript' src='/dwr/util.js'></script>
<script type='text/javascript' src='/dwr/interface/DWR_Register.js'></script>
<script type="text/javascript" src="../scripts/register.js"></script>
<script type="text/javascript" src="../scripts/loginpages.js"></script>
<script type="text/javascript" src="../scripts/localutils.js"></script>       